﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Il2CppAnti
{
    class ProcessCmd
    {
        public static void Execute(string exec, string command)
        {
            string cmd = $"{exec} {command}";
            Console.WriteLine(cmd);

            Process p = new Process();
            p.StartInfo.FileName = exec;
            p.StartInfo.Arguments = command;
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.CreateNoWindow = true;
            p.Start();

            string strOuput = p.StandardOutput.ReadToEnd();

            p.WaitForExit();
            p.Close();
            Console.WriteLine(strOuput);
        }
    }
}
